echo off
echo ======== Compilando JNITest.java ... ==========

set JAVA_JDK="C:\Program Files\Java\jdk1.6.0_22"
set JAVA_HOME="C:\Program Files\Java\jdk1.6.0_22\bin"

IF NOT EXIST %JAVA_JDK% GOTO NOJAVADIR

echo Adicionando a dll no jar
xcopy ..\Release\jni-test.dll .\
%JAVA_HOME%\jar -uvf JNITest.jar jni-test.dll
echo Assinando o . jar
%JAVA_HOME%\jarsigner -keystore keystore_jarsigner.jks -storepass filicube JNITest.jar 1
rem echo Movendo o . jar
rem copy JSETP.jar ..\bin\win32\

GOTO EXIT

:NOJAVADIR
echo off
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo ERROR: Java directory is invalid!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

:EXIT
echo =================FIM=========================
pause
